﻿/**
 * Proyecto: Cognitum
 * Global IT Services 2008
 * @author 
 */

Cognitum.Polizas.Siniestro.Beneficios.PagoBeneficio.Entity = function (){
	if (LOG.isDebugEnabled()) {
	    LOG.debug('[Cognitum.Polizas.Siniestro.Beneficios.PagoBeneficio.Entity.ctor] <-');
	}
	var listenersEditor = {
	    'descartar': {
	        fn: function(polizaId, folio, emitirRecibos, diferirPagoFraccionado, modalWindow){
                if (LOG.isDebugEnabled()) {
                    LOG.debug('[Siniestro.Beneficios.PagoBeneficio.Entity.descartar] ->');
                }
		    },
		    scope: this
	    }
	};		
	
	this.onOpen2 = function(id, listeners) {
		if (LOG.isDebugEnabled()) {
		    LOG.debug('[Siniestro.Beneficios.PagoBeneficio.Entity.onOpen2] <-');
		}		
		this.useInvoker(Karma.Conf.GetMethod, id, {
			fn: function(siniestro){
		        var entidad = Karma.Core.ModuleManager.Instance.getEntity('ComplementoGMM');
				entidad.openWindow(winId, siniestro, listenersEditor, {
					isNew: false
				});
	            this.fireEvent('open', winId);
			},
			scope: this
		});
	};

	Cognitum.Polizas.Siniestro.Beneficios.PagoBeneficio.Entity.superclass.constructor.call(this, false, true);
}

Ext.extend(Cognitum.Polizas.Siniestro.Beneficios.PagoBeneficio.Entity, Karma.Core.Entity, {
	id: 'PagoBeneficio.Entity',
	name: 'PagoBeneficio',
	editorXType: 'sin.benef.pago.editor',
	editorW: 670,
	editorH: 500,
	columns: [
		{ Name: 'Id', Property: 'Id', Mostrar: false },
	    { Name: 'Concepto', Property: 'Concepto' },
	    { Name: 'Monto', Property: 'Monto' },
	    { Name: 'FechaAdd', Property: 'FechaAdd' }
	],
	link: {
		displayProperty: 'Numero'
	},
	NewSiniestroMethod: 'NewWithOutParams',
	
	getCustomListeners: function(){
		return {		    
			'open': {
				fn: this.onOpen2,
				scope: this
			}			
		};
	}
});

Cognitum.PagosBeneficios = Cognitum.Polizas.Siniestro.Beneficios.PagoBeneficio.Entity;